import request from '@/utils/request.ts'

const baseURL = '/level'

/**
 * @name 新增关卡
 * @description
 */
function addNewLevel(data: any) {
  return request({
    method: 'POST',
    url: `${baseURL}/addNewLevel`,
    data
  })
}

/**
 * @name 获得所有关卡
 * @description 获得所有关卡
 */
function getAllLevel(data: any) {
  return request({
    method: 'GET',
    url: `${baseURL}/allLevels`,
    data
  })
}

/**
 * @name 删除关卡
 * @description 根据id删除关卡
 */
function deleteLevel(data: any) {
  return request({
    method: 'GET',
    url: `${baseURL}/deleteLevel`,
    data
  })
}

/**
 * @name 通过关卡
 * @description 根据id删除关卡
 */
function accessLevel(data: any) {
  console.log(data)

  return request({
    method: 'GET',
    url: `${baseURL}/accessLevel`,
    data
  })
}

export default {
  addNewLevel,
  getAllLevel,
  deleteLevel,
  accessLevel
}
